package com.example.service.impl;

import com.example.dao.EmployeeDao;
import com.example.entity.Employee;
import com.example.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.security.spec.ECField;
import java.util.List;

/**
 * @date 2020/8/13 18:42
 */
@Service("employeeService")
public class EmployeeServiceImpl implements EmployeeService {
    @Qualifier("employeeDao")
    @Autowired
    private EmployeeDao employeeDao;

    public void add(Employee employee) {
        employeeDao.insert(employee);
    }

    public void remove(Integer id) {
        employeeDao.delete(id);
    }

    public void edit(Employee employee) {
        employeeDao.update(employee);
    }

    public Employee get(Integer id) {
        return employeeDao.selectById(id);
    }

    public List<Employee> getAll() {
        return employeeDao.selectAll();
    }
}
